package com.lzm.niukeapi.api.factory;

import com.lzm.niukeapi.api.NiuKeRemoteApi;
import com.lzm.niukeapi.api.fallback.NiuKeRemoteApiFallbackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author scott
 * @date 2020/05/22
 */
@Component
public class NiuKeRemoteApiFallbackFactory implements FallbackFactory<NiuKeRemoteApi> {

    @Override
    public NiuKeRemoteApi create(Throwable throwable) {
        NiuKeRemoteApiFallbackImpl niuKeRemoteApiFallback = new NiuKeRemoteApiFallbackImpl();
        niuKeRemoteApiFallback.setCause(throwable);
        return niuKeRemoteApiFallback;
    }


}
